package com.zzh.myapplication.tools;

import android.content.Context;
import android.widget.Toast;

import net.icarplus.car.app.MyApplication;

/**
 * Toast统一管理类
 */
public class T {
	public static boolean isShow = true;

	private T() {
		throw new UnsupportedOperationException("cannot be instantiated");
	}

	public static void showShort(CharSequence msg) {
		System.out.println("fasf:application:" + MyApplication.getContext());
		if(isShow && msg != null && !S.isEmpty(msg.toString()) && MyApplication.getContext() != null) {
			Toast.makeText(MyApplication.getContext(), msg, Toast.LENGTH_SHORT).show();
		}

	}

	public static void showLong(CharSequence msg) {
		if(isShow && msg != null && !S.isEmpty(msg.toString()) && MyApplication.getContext() != null) {
			Toast.makeText(MyApplication.getContext(), msg, Toast.LENGTH_LONG).show();
		}

	}

	public static void showShort(Context context, CharSequence message) {
		if(isShow) {
			Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
		}

	}

	public static void showShort(Context context, int message) {
		if(isShow) {
			Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
		}

	}

	public static void showLong(Context context, CharSequence message) {
		if(isShow) {
			Toast.makeText(context, message, Toast.LENGTH_LONG).show();
		}

	}

	public static void showLong(Context context, int message) {
		if(isShow) {
			Toast.makeText(context, message, Toast.LENGTH_LONG).show();
		}

	}

	public static void show(Context context, CharSequence message, int duration) {
		if(isShow) {
			Toast.makeText(context, message, duration).show();
		}

	}

	public static void show(Context context, int message, int duration) {
		if(isShow) {
			Toast.makeText(context, message, duration).show();
		}

	}
}